package me.kagami.exex.intercepter;

import java.util.List;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;

public class LineNumberIntercepter extends InsertDataIntercepter {

	@Override
	public void beforeAssembleData(Sheet sheet, List<?> dataList, int beginRowNum, int beginColNum) {
		this.getContext().getCellStyleList().remove(0);
	}

	@Override
	public <T> void beforeInsertRow(Row row, T dataBean, int rowNumber) {
		Cell lineCell = row.createCell(0);
		lineCell.setCellValue(rowNumber + 1);
	}

}
